package view.render.weapon
{
	import enums.main.UISize;
	
	import model.vo.weapon.BaseBowGunWeaponVo;
	
	import util.WeaponUtil;
	
	/**
	 * 弩类武器简表item基类
	 * @author £iang
	 * 
	 */	
	public class BaseBowGunSimpleItem extends BaseWeaponSimpleItem
	{
		//-----------------------------
		// variables
		//-----------------------------
		
		//-----------------------------
		// properties
		//-----------------------------
		
		//-----------------------------
		// setter&getter
		//-----------------------------
		
		//-----------------------------
		// methods
		//-----------------------------
		
		/**
		 * 调整组件 
		 * 
		 */		
		override protected function draw():void
		{
			super.draw();
			
			thirdLabel.y =  ( _itemH - 86 ) / 2 * UISize.DPI_SCALE;
		}
		
		/**
		 * 设置弩类数据 
		 * @param data
		 * 
		 */		
		public function setBowGunData( data:BaseBowGunWeaponVo ):void
		{
			var nameStr:String = data.name + "(" + data.nickName +")";
			
			weaponId = data.weaponId;
			if ( data.isFinal  )
				firstLabel.text = "■";
			firstLabel.text += nameStr;
			firstLabel.color = WeaponUtil.getRareColor( data.rare );
			attackLabel.text = data.attack.toString();
			if ( data.specialBullet )
				secondLabel.text = WeaponUtil.getSimpleSpecialBulletNamesText( data.specialBullet );
			
			thirdLabel.text = WeaponUtil.getBowGunReloadText( data.reloadSpeed ) + "," + 
				WeaponUtil.getBowGunReactionText( data.reaction ) + "<br/>" +
				WeaponUtil.getBowGunOffsetText( data.offsetDirection, data.offsetLevel );
			
			if ( data.specialBullet && data.specialBullet.length > 2 )
				secondLabel.y =  ( _itemH - 86 ) / 2 * UISize.DPI_SCALE;
		}
		
		//-----------------------------
		// events
		//-----------------------------
		
		//-----------------------------
		// dispose
		//-----------------------------
		
		//-----------------------------
		// construction
		//-----------------------------
		
		/**
		 * 构造函数
		 *
		 */
		public function BaseBowGunSimpleItem()
		{
			super();
		}
	}
}